<div id="J_sidebar" class="side_rights">
	<div class="side-box">
		<ul class="side-oper">
			<li class="normal side-user">
				<a class="links" id="J_user" target="_blank" href="{:U('user/index')}" _hover-ignore="1"><i class="normal-icon i-user"></i></a>
				<div id="side-login" class="tab-tips tab-login" style="opacity: 0; right: 62px; display: none;">
					<div class="user-box">
						<div class="pic"><img src="/data/upload/avatar/default_64.jpg"></div>
						<p class="txt"> <a target="_blank" href="{:U('user/login')}">登录</a>          <a target="_blank" href="{:U('user/register')}">注册</a></p>
					</div>
					<i class="close">×</i>
					<div class="arr-icon">◆</div>
				</div>
			</li>
			<li class="normal side-cart">
				<a class="links links-cart" id="J_cart" href="javascript:;"><i class="normal-icon i-cart"></i><em class="num cartnum">0</em></a>
				<div class="tab-tips tab-tag" style="opacity: 0; display: none; right: 62px;">
					<div class="carttime" style="display: none;"></div>
					<div class="arr-icon">◆</div>
				</div>
			</li>
			<li class="normal side-love">
				<a class="links" id="J_love" target="_blank" href="{:U('user/like')}"><i class="normal-icon i-love"></i></a>
				<div class="tab-tips" style="opacity: 0; display: none; right: 62px;">我的收藏<div class="arr-icon">◆</div></div>
			</li>
			<li class="normal side-quan">
				<a class="links" id="J_quan" target="_blank" href="{:U('user/gift')}"><i class="normal-icon i-quan"></i></a>
				<div class="tab-tips" style="opacity: 0; display: none; right: 62px;">我的礼品<div class="arr-icon">◆</div></div>
			</li>
		</ul>
		<ul class="side-oper other">
			<li class="normal side-complain">
				<a class="links" id="J_complain" target="_blank" href="{:U('user/msg',array('do'=>'send'))}"><i class="normal-icon i-complain"></i></a>
				<div class="tab-tips" style="opacity: 0; right: 62px; display: none;">意见反馈<div class="arr-icon">◆</div></div>
			</li>
			<li class="normal side-code">
				<a class="links" id="J_code" href="javascript:;"><i class="normal-icon i-code" _hover-ignore="1"></i></a>
				<div class="tab-tips" style="opacity: 0; right: 62px; display: none;" _hover-ignore="1">
					<div class="code-box">
						<p class="code"><img src="__STATIC__/taoke/images/layout/download_app.png" width="90px"></p><p class="txt">扫描下载二维码</p>
					</div>
					<div class="arr-icon">◆</div>
				</div>
			</li>
			<li class="normal side-backtop">
				<a class="links" id="J_backtop" href="javascript:;" style="display: none;"><i class="normal-icon i-backtop"></i></a>
				<div class="tab-tips" style="opacity: 0; display: none; right: 62px;">返回顶部<div class="arr-icon">◆</div></div>
			</li>
		</ul>
	</div>
</div>
<script>

(function($){
    $.fn.slowShow = function(ele,time){
        time = time == undefined?100:time;
        var timer=null;
        clearInterval(timer);
        this.hover(function(){
                clearTimeout(timer);
                timer=setTimeout(function(){
                    ele.show();
                },time);
            },
            function(){
                clearTimeout(timer);
                timer=setTimeout(function(){
                    ele.hide();
                },time);
            }
        )
    }
})(jQuery);

(function($){
    $('a.go-top').click(function(){
        $('body,html').animate({scrollTop:0},500);
    });
    $('#J_sidebar .side-box a#J_backtop').click(function(){
        $('body,html').animate({scrollTop:0},500);
    });
    //显示回到顶部按钮
    var backtop_show=function(){
        $(window).scroll(function(){
            var st=$(window).scrollTop();
            if(st>0){
               $("a#J_backtop").css("display","block"); 
            }
            else{
                $("a#J_backtop").css("display","none");
                $("a#J_backtop").parents().find(".tab-tips").css({"opacity":"0","display":"none","right":"62px"});
            }
        })
    }
    backtop_show();
   
    var $obj=null;
    var timer=null;
    var normal_show_fun=function(){
        clearInterval(timer);
        $('#J_sidebar .side-oper li').hover(function(){
                $('#J_sidebar .side-oper li').find(".tab-tips").css({"opacity":"0","display":"none","right":"62px"})
                $('#J_sidebar .side-oper li').removeClass("curr");
                $("#J_sidebar .side-oper li.side-cart").removeClass("selected");
                $obj=$(this);
                clearTimeout(timer);
                timer=setTimeout(function(){
                    $obj.addClass("curr");
                    if($obj.hasClass("side-cart")){
                        if($obj.find(".carttime").html()=="" || $obj.find("em.cartnum").html()=="0"){
                            $('.carttime').hide();
                            return;
                        }
                    }
                    if(($obj.hasClass("side-backtop") && $obj.find("a.links").css("display")=="none")||($obj.hasClass("side-cart") && $obj.find("#side-empty").css("display")=="block")){
                        return;
                    }else{
                        $obj.find(".tab-tips").css("opacity","1");
                        $obj.find(".tab-tips").animate({
                            right: 36,opacity: 'show'
                        }, 300);
                    }
                },100);
                if($obj.hasClass("side-user")){
                    $obj.find(".close").on('click',function(){
                        $obj.find(".tab-tips").css({"opacity":"0","display":"none","right":"62px"});
                    })
                }
            },
            function(){
                clearTimeout(timer);
                timer=setTimeout(function(){
                    $obj.removeClass("curr");
                    $obj.find(".tab-tips").css({"opacity":"0","display":"none","right":"62px"});
                    if($obj.hasClass("side-cart")){
                        $obj.removeClass("selected");
                    }
                },100);
            }
        )        
    }
    normal_show_fun(); //鼠标移入在左侧显示信息的效果
})(jQuery);
</script>
